package com.hmy.contract.client.contract;

import com.hmy.ccp.common.result.FeignResult;
import com.hmy.contract.bo.request.contract.*;
import com.hmy.contract.bo.response.contract.ContractInfoListResponse;
import com.hmy.contract.bo.response.contract.ContractInfoResponse;
import com.hmy.contract.bo.response.contract.ContractSignTaskCancelApiResponse;
import com.hmy.contract.bo.response.contract.CreateContractResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author seven.qi 齐胜南
 * @version 1.0
 * @description 合同管理feign客户端
 * @date 2023/12/20 17:21
 */
@FeignClient("hmy-contract")
public interface ContractClient {

    /**
     * 根据合同id查询合同详情
     *
     * @param contractInfoRequest
     * @return
     */
    @PostMapping("/feign/contract/contractInfo")
    FeignResult<ContractInfoResponse> contractInfo(@RequestBody ContractInfoRequest contractInfoRequest);

    /**
     * 根据合同id查询合同详情
     *
     * @param contractInfoRequest
     * @return
     */
    @PostMapping("/feign/contract/contractInfoBySignTaskId")
    FeignResult<ContractInfoResponse> contractInfoBySignTaskId(@RequestBody ContractInfoRequest contractInfoRequest);

    /**
     * 签署完成操作
     *
     * @param contractSignFinishedRequest
     * @return
     */
    @PostMapping("/feign/contract/signFinished")
    FeignResult<ContractInfoResponse> signFinished(@RequestBody ContractSignFinishedRequest contractSignFinishedRequest);

    /**
     * 条件查询合同列表
     *
     * @param contractInfoListRequest
     * @return
     */
    @PostMapping("/feign/contract/contractInfoList")
    FeignResult<ContractInfoListResponse> contractInfoList(@RequestBody ContractInfoListRequest contractInfoListRequest);

    @PostMapping("/feign/contract/createContract")
    FeignResult<CreateContractResponse> createContract(@RequestBody CreateContractRequest createContractRequest);

    @PostMapping("/feign/contract/cancelContract")
    FeignResult<ContractSignTaskCancelApiResponse> cancelContract(@RequestBody ContractSignTaskCancelApiRequest request);
}
